#include <stdio.h>

/**
 * 变量的声明
 */
int main(void) {
	/*
	 * 月
	 * 声明一个整型数
	 */
	int month;
	/*
	 * 费用、收入
	 * 声明两个浮点型，当把一个没有小数点的数赋值给一个float变量时，编译器自动加上小数点
	 */
	float expense, income;

	// 赋值
	month = 12;
	expense = 111.1F;
	income = 100.F;

	// 格式化打印
	printf("Month=%2d, Expense=$%9.2f\n", month, expense);

	// 重新赋值
	month = 11;
	expense = 82.1F;

	printf("For the %2dth month of the year\n"
		   "the expenses were $%5.2f \n"
		   "and the income was $%6.2f\n\n", month, expense,
		   income);

	// 运算符的优先级：% * / + -
	int i = 1;
	int j = 2;
	int k = 3;
	i += j *= k %= 2;
	printf("i=%d\n", i);
	printf("j=%d\n", j);
	printf("k=%d\n", k);


}